Generally, in database systems, several individual records of data may be stored in tables. Each table may identify fields, or columns, and individual records may be stored as rows, with a data entry in each column. For example, in a parts database, there may be a table “Parts” which includes fields such as part name, part size, part brand, and the like. One record, which includes data in the several columns, would be entered in the Parts table for each part.
One operation that may be performed on database systems is locating specific records within individual tables based on criteria of one or more fields (or columns). The database system may scan through every entry in a particular table to locate the desired records. However, this method may require the database system to scan an entire table which may undesirably consume a considerable amount of time.
To reduce the time required to locate particular records in a database, database indexes may be established. Generally, a database index is a data structure that improves the speed of operations on a database table. Indexes can be created using one or more columns of a database table, providing the basis for both rapid random look ups and efficient access of ordered records. The disk space required to store the index may be less than that required by the table (since indexes usually contain only key-fields according to which the table is to be arranged, and excludes the other details in the table), yielding the possibility to store indexes in memory for a table whose data is too large to store in memory.
When an index is created, it may record the location of values in a table that are associated with the column that is to be indexed. Entries may be added to the index when new data is added to the table. When a query is executed against the database and a condition is specified on a column that is indexed, the index is first searched for the values specified. If the value is found in the index, the index may return the location of the searched data in the table to the entity requesting the query.